package cn.lysj.framework.store.repository;

import cn.lysj.framework.base.BaseRepository;
import cn.lysj.framework.store.domain.Store;
import cn.lysj.framework.store.vo.StoreVo;
import org.springframework.data.jpa.repository.Query;

/**
 * @author drj
 * @description 门店数据处理层
 * @create 2018-10-29 10:02:38
 **/
public interface StoreRepository extends BaseRepository<Store> {
    Store findByUserIdAndDelFlag(String id,Integer flag);

    @Query(value = "select new cn.lysj.framework.store.vo.StoreVo(a.name,a.userId,a.photo,a.phone,a.address,a.businessTime,a.notice,b.username,a.supporyPayWay) from Store a , User b where a.id = ?1 and a.userId = b.id")
    StoreVo findUserId(String storeId);
}